<template>
  <div id="beginView">
    <div id="BeginTille">{{ textInfo.textTitlle }}</div>
    <div id="beginDescribe">
        {{ textInfo.textContant }}
    </div>
    <div id="beginButton">
      <el-button type="success" style="margin-top: 7px" @click="playVoice"
        >开始挑战</el-button
      >
      <el-button type="success" style="margin-top: 7px" @click="back"
        >返回首页</el-button
      >
    </div>
  </div>
</template>

<script>
import { myHandleSpeak, handleStop } from "@/utils/speack";
export default {
  props:["textInfo"],
  data() {
    return {
        isOpend:true,
        countDwon:15,
        isEnd:false
    };
  },
  mounted(){
    console.log(this.textInfo)
  },
  methods: {
    playVoice() {
      handleStop();
      myHandleSpeak(this.textInfo.val);
      this.isOpend=!this.isOpend
      this.$emit("isOpen",2)
    },
    back() {
      this.$router.push("/home");
    },
  },
};
</script>

<style lang="less" scoped>
#beginView {
  position: absolute;
  z-index: 100;
  background: #b1cceb;
  width: 90vw;
  height: 60vh;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px 10px 5px 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  #BeginTille {
    font-weight: 700;
    font-size: 22px;
    margin-top: 2vh;
    letter-spacing: 2px;
  }
  #beginDescribe {
    padding: 30px;
    font-size: 18px;
    line-height: 35px;
    color: white;
    letter-spacing: 2px;
    text-align: left;
    text-indent: 20px;
  }
}
</style>